/*
 * @desc:
 * @Author: 钟强
 * @Date: 2021-12-02 14:16:05
 * @LastEditors: 钟强
 * @LastEditTime: 2021-12-15 15:20:24
 */
import i18n from '../i18n'
import store from '../store'
import { watch } from 'vue'

export function generateTitle (title) {
  return i18n.global.t('msg.route.' + title)
}

/**
 *
 * @param  {...any} cbs 所有的回调
 */
export function watchSwitchLang (...cbs) {
  watch(
    () => store.getters.language,
    () => {
      cbs.forEach(cb => cb(store.getters.language))
    }
  )
}
